using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace tKitchen
{
    public partial class MealCalendarDay : UserControl
    {
        /// <summary>
        /// Set the number to display for this day. 
        /// A negative value results in a blank day.
        /// </summary>
        public int DayNumber
        {
            get { return Int32.Parse(label1.Text); }
            set
            {
                if (value < 0)
                {
                    label1.Text = "";
                }
                else
                {
                    label1.Text = value.ToString();
                }
            }
        }

        public event EventHandler ListDoubleClicked = delegate { };
        public event EventHandler NewMealMenuItemClicked = delegate { };
        public event EventHandler DeleteMenuItemClicked = delegate { };

        public ListBox List
        {
            get { return listBox1; }
            //set { listBox1.Items = value; }
        }


        public MealCalendarDay()
        {
            InitializeComponent();
            listBox1.ContextMenuStrip = contextMenuStrip1;
        }

        private void newMealToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NewMealMenuItemClicked(this, e);
        }

        private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DeleteMenuItemClicked(listBox1, e);
        }



        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void listBox1_DoubleClick(object sender, EventArgs e)
        {
            // e is MouseEventArgs
            ListDoubleClicked(sender, e);
        }


    }
}
